package com.system.api.setting.entity.po;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.Accessors;
import org.yang.common.core.annotation.Chinese;
import org.yang.database.orm.entity.BaseModel;

import static com.system.common.constant.MessageConstant.*;

/**
 * 字典词条实体
 * @author lslands
 * @date 2024/5/18 23:08
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class SysDictItem extends BaseModel {



    /**
     * 关联目录编码
     * @mock enabled
     *  @required
     */
    @Chinese
    @NotBlank(message = CATALOGUE_CODE_EMPTY)
    private String dictCode;

    /**
     * 键
     * @mock 开启
     * @required
     */
    @NotBlank(message = ENTRY_NAME_EMPTY)
    private String label;

    /**
     * 值
     * @mock 1
     * @required
     */
    @Chinese
    @NotBlank(message = ENTRY_VALUE_EMPTY)
    private String value;

    /**
     * 类型(null | success | danger | info | primary | warning)
     * @mock success
     */
    private String type;

    /**
     * 数据类型(0/int;1/String)
     * @mock 0
     */
    private Integer scope;

    /**
     * 是否默认
     * @mock false
     */
    private Boolean defaulted;

    public SysDictItem(Long id, Integer enabled, Integer revision) {
        super(id, enabled, revision);
    }

    public SysDictItem(Long id, Boolean defaulted,Integer revision) {
        super(id, revision);
        this.defaulted = defaulted;
    }
}